package com.freewater.cargotracker.domain.model.cargo;

import com.freewater.cargotracker.domain.model.customer.CustomerNo;
import com.github.meixuesong.aggregatepersistence.Aggregate;

import java.util.List;

public interface CargoRepository {

    void save(Cargo cargo);

    void save(Aggregate<Cargo> cargoAggregate);

    TrackingId nextTrackingId();

    Cargo findById(Long id);

    Cargo findByTrackingId(TrackingId trackingId);

    Aggregate<Cargo> findAggregateByTrackingId(TrackingId trackingId);

    List<Cargo> findCargosOfCustomer(CustomerNo customerNo);

    int quantityBooked(EnterpriseSegment enterpriseSegment);
}
